// 云函数入口文件
const cloud = require('wx-server-sdk')

cloud.init({ env: cloud.DYNAMIC_CURRENT_ENV }) // 使用当前云环境

// 云函数入口函数
exports.main = async (event, context) => {
  try {
    const result = await cloud.openapi.cloudbasewx.sendSms({
      "access_token":"https://api.weixin.qq.com/tcb/sendsms?access_token=ACCESS_TOKEN",
      "env":"cloud1-6g2tfsziad902596",
      "phone_number_list":[
        "+8615817363598"
      ],
      "sms_type": "Marketing",
      "content":"发布了新的能力",
      "path":"/index.html",
      "use_short_name": true
    })
    return "我已被调用"+result
  } catch (error) {
    return error
  }
}